package Test;

public class Test12 {
    public static void main(String[] args) {
        StringBuilder stringBuilder = new StringBuilder("hello");
        stringBuilder.reverse();
        System.out.println(stringBuilder);
    }

    //字符串分割
    public static void main2(String[] args) {
        String str = "Hello World";
        String[] ret = str.split(" ");
        for (String s : ret) {
            System.out.println(s);
        }
    }

    //字符串截取
    public static void main1(String[] args) {
        String str = "abcab";
        String ret = str.substring(2);
        String ret1 = str.substring(0,2);
        System.out.println(ret);
        System.out.println(ret1);
    }
}
